/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.tramite.bc;

import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.cip.esymons.colegiatura.bc.ColegiadoImagenFacadeLocal;
import org.cip.esymons.colegiatura.be.ColegiadoImagen;

/**
 *
 * @author Cristian
 */
public class ColegiadoImagenDelegate {
    private ColegiadoImagenFacadeLocal local;

    public ColegiadoImagenDelegate() {
        local=lookupColegiadoImagenFacade();
    }

    public ColegiadoImagen buscaFoto(Long codigo){
        return local.buscaFoto(codigo);
    }

    public ColegiadoImagen buscaFiram(Long codigo){
        return local.buscaFirma(codigo);
    }

    public List<ColegiadoImagen> listaSellos(Long codigo){
        return local.buscaSellos(codigo);
    }

    private ColegiadoImagenFacadeLocal lookupColegiadoImagenFacade() {
        try {
            Context c = new InitialContext();
            return (ColegiadoImagenFacadeLocal) c.lookup("java:comp/env/ColegiadoImagenFacade");
        } catch (NamingException ne) {
            Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);
        }
    }

}
